{% extends 'pc/base.html' %}
{% load static %}
{% block css %}
         <link rel="stylesheet" href="{% static 'markdown/css/editormd.css' %}" />
    <link rel="stylesheet" href="{% static 'css/course.css' %}">
    <input type="hidden" value="{{uuid }}">
    <style>
    body{
        background: #f7f7f7;
    }
    .is_active{
        font-weight: bold;
        background: #f3f3f3;
        margin: 0 auto;
    }

    </style>
{% endblock %}
{% block link_js %}

        <script src="{% static 'markdown/lib/marked.min.js' %}"></script>
        <script src="{% static 'markdown/lib/prettify.min.js' %}"></script>
        <script src="{% static 'markdown/lib/raphael.min.js' %}"></script>
        <script src="{% static 'markdown/lib/underscore.min.js' %}"></script>
        <script src="{% static 'markdown/lib/sequence-diagram.min.js' %}"></script>
        <script src="{% static 'markdown/lib/flowchart.min.js' %}"></script>
        <script src="{% static 'markdown/lib/jquery.flowchart.min.js' %}"></script>
        <script src="{% static 'markdown/editormd.js' %}"></script>



{% endblock %}
{% block content %}
    <div class="container clearfix">
        <div class="Catalog fl">
            <h3 style="height:48px;line-height: 48px;text-align: center;border-bottom: 1px solid #eee;">目录</h3>
            <ul id="menu">

                {% for foo in course %}
                    <li data-key="{{ foo.id }}"><a style="display: block;padding: 0 15px;    white-space: nowrap;
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;" href="/course/{{uuid }}/{{ foo.id }}.html">{{ foo.titles }}</a></li>
                {% endfor %}

            </ul>
        </div>
        <div class="content fr">
            <div>
                <div class="pageNav clearfix">
                    <div class="fl">
                        {% if netx_blog %}
                        <a style="display: block" href="/course/{{uuid }}/{{ netx_blog.id }}.html">< 前一页</a>
                        {% else %}
                        没有了
                        {% endif %}
                    </div>
                    <div class="fr">
                        {% if previous_blog %}
                        <a style="display: block" href="/course/{{uuid }}/{{ previous_blog.id }}.html">后一页 ></a>
                            {% else %}
                            没有了
                        {% endif %}
                    </div>
                </div>
                <div>
                <h1>{{ content.titles }}</h1>

                <div id="test-editormd-view2"style="box-sizing: border-box;">
                    <textarea id="append-test" name="test-editormd-markdown-doc" style="display:none;">{{ content.conent}}</textarea>
                </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block js %}
    <script>
    var url = window.location.pathname.split('/');
    var path = url[url.length-2];
    var ias= path.replace(/[^0-9]/ig,"");
        $('#menu li').each(function (index,item) {
            if ($(item).attr('data-key') == ias){
                $(item).find('a').addClass('is_active')
            }
        });
            $(function() {
                //$('.content').css('height',$(document).height()-140+'px')
            var testEditormdView;
            testEditormdView = editormd.markdownToHTML("test-editormd-view2", {
                htmlDecode      : "style,script,iframe",  // you can filter tags decode
                emoji           : true,
                taskList        : true,
                tex             : true,  // 默认不解析
                flowChart       : true,  // 默认不解析
                sequenceDiagram : true,  // 默认不解析
            });
        });
    </script>
{% endblock %}